﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZGEDrySaltery.Code;
using ZGEDrySaltery.Model;

namespace ZGEDrySaltery.BLL
{
    public class ObjectCategoryBLL
    {
        /// <summary>
        /// 写日志
        /// </summary>
        private Log log;

        #region 单例模式
        private static ObjectCategoryBLL instance;

        public static ObjectCategoryBLL GetInstance()
        {
            if (instance == null)
            {
                lock (typeof(ObjectCategoryBLL))
                {
                    if (instance == null)
                    {
                        instance = new ObjectCategoryBLL();
                    }
                }
            }
            return instance;
        }
        private ObjectCategoryBLL()
        {
            log = LogFactory.GetLogger(this.GetType().ToString());
        }

        #endregion

        #region 获取所有分类列表
        /// <summary>
        /// 获取所有分类列表
        /// </summary>
        /// <returns></returns>
        public List<ObjectCategoryModel> GetObjectCategoryList()
        {
            try
            {
                List<ObjectCategoryModel> oblist = DAL.ObjectCategoryDAL.GetInstance().GetObjectCategoryList(0, 0, "");
                return oblist;
            }
            catch (Exception ex)
            {
                log.Error(ex.Message);
            }
            return null;
        }
        #endregion

        
    }
}
